package com.xihuanjun.sdk.entity;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

@Data
@ToString
@NoArgsConstructor
@JsonAutoDetect(fieldVisibility= JsonAutoDetect.Visibility.ANY,getterVisibility= JsonAutoDetect.Visibility.NONE)
public class JSTGoodsStock {

    private String sku_id;

    private Integer qty;

    private Integer order_lock;

    private Integer can_use;

    public Integer getCan_use() {
        return can_use;
    }



    public String getSku_id() {
        return sku_id;
    }

    public void setSku_id(String sku_id) {
        this.sku_id = sku_id;
    }

    public Integer getQty() {
        return qty;
    }

    public void setQty(Integer qty) {
        this.qty = qty;
        if(qty!=null &&order_lock!=null){
            this.can_use=this.qty-this.order_lock;
        }
    }

    public Integer getOrder_lock() {
        return order_lock;
    }

    public void setOrder_lock(Integer order_lock) {
        this.order_lock = order_lock;
        if(qty!=null &&order_lock!=null){
            this.can_use=this.qty-this.order_lock;
        }
    }


    @Override
    public String toString() {
        return "JSTGoodsStock{" +
                "sku_id='" + sku_id + '\'' +
                ", qty=" + qty +
                ", order_lock=" + order_lock +
                ", can_use=" + can_use +
                '}';
    }
}
